import 'create_user_info_model.dart';

class MyCircleData {
  List<MyCircleBean> content;
  int totalElements;
  int totalPages;
  int size;
  int number;
  int numberOfElements;

  MyCircleData(
      {this.content,
      this.totalElements,
      this.totalPages,
      this.size,
      this.number,
      this.numberOfElements});

  MyCircleData.fromJson(Map<String, dynamic> json) {
    if (json['content'] != null) {
      content = new List<MyCircleBean>();
      json['content'].forEach((v) {
        content.add(new MyCircleBean.fromJson(v));
      });
    }
    totalElements = json['totalElements'];
    totalPages = json['totalPages'];
    size = json['size'];
    number = json['number'];
    numberOfElements = json['numberOfElements'];
  }

  Map<String, dynamic> toJson() {
    final Map<String, dynamic> data = new Map<String, dynamic>();
    if (this.content != null) {
      data['content'] = this.content.map((v) => v.toJson()).toList();
    }
    data['totalElements'] = this.totalElements;
    data['totalPages'] = this.totalPages;
    data['size'] = this.size;
    data['number'] = this.number;
    data['numberOfElements'] = this.numberOfElements;
    return data;
  }
}

class MyCircleBean {
  String id;
  String auditStatus;
  String publishStatus;
  List<DisplayAudits> displayAudits;
  int createTime;
  String title;
  String publishDate;
  String description;
  List<Products> products;
  List<ImagesBean> medias = [];
  String officialFlag;
  String autoPublish;
  String amwayId;
  String ada;
  String ugcId;
  String officialPgcId;
  String content;
  List<String> officialId;

  MyCircleBean(
      {this.id,
      this.auditStatus,
      this.publishStatus,
      this.content,
      this.displayAudits,
      this.createTime,
      this.title,
      this.description,
      this.products,
      this.medias,
      this.officialFlag,
      this.autoPublish,
      this.publishDate,
      this.amwayId,
      this.ada,
      this.ugcId,
      this.officialId,
      this.officialPgcId});

  MyCircleBean.fromJson(Map<String, dynamic> json) {
    id = json['id'];
    auditStatus = json['auditStatus'];
    publishStatus = json['publishStatus'];
    if (json['displayAudits'] != null) {
      displayAudits = new List<DisplayAudits>();
      json['displayAudits'].forEach((v) {
        displayAudits.add(new DisplayAudits.fromJson(v));
      });
    }
    createTime = json['createTime'];
    title = json['title'];
    description = json['description'];
    if (json['products'] != null) {
      products = new List<Products>();
      json['products'].forEach((v) {
        products.add(new Products.fromJson(v));
      });
    }
    if (json['medias'] != null) {
      medias = new List<ImagesBean>();
      json['medias'].forEach((v) {
        medias.add(new ImagesBean.fromJson(v));
      });
    }
    officialFlag = json['officialFlag'];
    autoPublish = json['autoPublish'];
    amwayId = json['amwayId'];
    ada = json['ada'];
    ugcId = json['ugcId'];
    officialPgcId = json['officialPgcId'];
  }

  Map<String, dynamic> toJson() {
    final Map<String, dynamic> data = new Map<String, dynamic>();
    data['id'] = this.id;
    data['auditStatus'] = this.auditStatus;
    data['publishStatus'] = this.publishStatus;
    if (this.displayAudits != null) {
      data['displayAudits'] =
          this.displayAudits.map((v) => v.toJson()).toList();
    }
    data['createTime'] = this.createTime;
    data['title'] = this.title;
    data['description'] = this.description;
    if (this.products != null) {
      data['products'] = this.products.map((v) => v.toJson()).toList();
    }
    if (this.medias != null) {
      data['medias'] = this.medias.map((v) => v.toJson()).toList();
    }
    data['officialFlag'] = this.officialFlag;
    data['autoPublish'] = this.autoPublish;
    data['amwayId'] = this.amwayId;
    data['ada'] = this.ada;
    data['ugcId'] = this.ugcId;
    data['officialPgcId'] = this.officialPgcId;
    return data;
  }
}

class DisplayAudits {
  Null id;
  String data;
  String status;
  String resourceType;
  String propertyNameTip;

  DisplayAudits(
      {this.id,
      this.data,
      this.status,
      this.resourceType,
      this.propertyNameTip});

  DisplayAudits.fromJson(Map<String, dynamic> json) {
    id = json['id'];
    data = json['data'];
    status = json['status'];
    resourceType = json['resourceType'];
    propertyNameTip = json['propertyNameTip'];
  }

  Map<String, dynamic> toJson() {
    final Map<String, dynamic> data = new Map<String, dynamic>();
    data['id'] = this.id;
    data['data'] = this.data;
    data['status'] = this.status;
    data['resourceType'] = this.resourceType;
    data['propertyNameTip'] = this.propertyNameTip;
    return data;
  }
}

class Products {
  String skuCode;
  String productCode;
  String skuName;
  String productName;
  String picture;
  PriceData priceData;

  Products(
      {this.skuCode,
      this.productCode,
      this.skuName,
      this.productName,
      this.picture,
      this.priceData});

  Products.fromJson(Map<String, dynamic> json) {
    skuCode = json['skuCode'];
    productCode = json['productCode'];
    skuName = json['skuName'];
    productName = json['productName'];
    picture = json['picture'];
    priceData = json['priceData'] != null
        ? new PriceData.fromJson(json['priceData'])
        : null;
  }

  Map<String, dynamic> toJson() {
    final Map<String, dynamic> data = new Map<String, dynamic>();
    data['skuCode'] = this.skuCode;
    data['productCode'] = this.productCode;
    data['skuName'] = this.skuName;
    data['productName'] = this.productName;
    data['picture'] = this.picture;
    data['priceData'] = this.priceData;
    return data;
  }
}

class PriceData {
  double price;

  PriceData({this.price});

  PriceData.fromJson(Map<String, dynamic> json) {
    price = json['price'];
  }

  Map<String, dynamic> toJson() {
    final Map<String, dynamic> data = new Map<String, dynamic>();
    data['price'] = this.price;
    return data;
  }
}

class Medias {
  String cover;
  String data;
  String officialFlag;
  String dataType;
  int no;

  Medias({this.cover, this.data, this.officialFlag, this.dataType, this.no});

  Medias.fromJson(Map<String, dynamic> json) {
    cover = json['cover'];
    data = json['data'];
    officialFlag = json['officialFlag'];
    dataType = json['dataType'];
    no = json['no'];
  }

  Map<String, dynamic> toJson() {
    final Map<String, dynamic> data = new Map<String, dynamic>();
    data['cover'] = this.cover;
    data['data'] = this.data;
    data['officialFlag'] = this.officialFlag;
    data['dataType'] = this.dataType;
    data['no'] = this.no;
    return data;
  }
}
